<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<title>khutro.net</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/userpage.css" rel="stylesheet" type="text/css">
<link href="css/button.css" rel="stylesheet" type="text/css">
<script src="SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
<script src="js/jquery-1.8.2.js"></script>
<SCRIPT type="text/javascript" src="js/items.js"></SCRIPT>
<link href="css/search.css" rel="stylesheet" type="text/css">
<link href="css/form.css" rel="stylesheet" type="text/css">
<script src="js/scroll-startstop.events.jquery.js"
	type="text/javascript"></script>
<script src="js/gen_validatorv4.js" type="text/javascript"></script>
<script src="js/numberonly.js" type="text/javascript"></script>

<link rel="stylesheet" type="text/css" href="css/style.css" />
<style>
#sidebar {
	width: 140px;
	background-color: #FAFAFA;
	margin: 150px 0 15px 0;
	padding: 0px 0px;
	float: left;
	top: 400px;
	left: 0px;
}

#sidebar1 {
	width: 140px;
	background-color: #FAFAFA;
	margin: 150px 0 15px 0;
	padding: 0px 0px;
	float: right;
	top: 400px;
	right: 0px;
}
</style>
<style>
#inline1 {
	display: none;
	width: 600px;
	height: 600px
}
</style>
<style type="text/css">
.ac_over {
	color: white; background-color:green;
}
</style>
<link rel="stylesheet" type="text/css" media="all"
	href="css/jquery.fancybox.css">
<script type="text/javascript"
	src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.fancybox.js"></script>
<script type="text/javascript" src="js/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="js/search.js"></script>
<script src="js/jquery-ui-1.9.0.custom.js"></script>

<script type="text/javascript">
	jQuery(document).ready(function($) {
		jQuery(".modalbox").fancybox();
	});
</script>
<link href="SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet"
	type="text/css">
<link rel="stylesheet" href="css/stylesconfirm.css">
<script type="text/javascript" src="script/jquery.reveal.js"></script>
<script src="js/jqFancyTransitions.1.8.js"></script>
</head>
<body>
<form action="" id="urlpath" name="urlpath">
<input id="testurl" type="hidden" value=""/>
</form>
<script type="text/javascript">
	var path = window.location;
	urlpath.elements["testurl"].value = path;
</script>

	<div id="fb-root"></div>
	<script>
		(function(d, s, id) {
			var js, fjs = d.getElementsByTagName(s)[0];
			if (d.getElementById(id))
				return;
			js = d.createElement(s);
			js.id = id;
			js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1";
			fjs.parentNode.insertBefore(js, fjs);
		}(document, 'script', 'facebook-jssdk'));
	</script>
	<!-- 	<div id="sidebar" style="position: fixed; margin-left: 0px; top: 0px;"> -->

	<!-- Save for Web Slices (khutroslide.psd) -->
	<div id="header">
		<div id="headerContent">
			<a href="index.action" id="logo">khutro</a>
			<ul id="menuBar">
				<li><a href="index.action">Trang chủ</a></li>
				<li><a href="help.jsp">Trợ giúp</a></li>
				<li><a href="checkaddtopic.action">Đăng cho thuê</a>
				<li><a href="checkaddsharetopic.action">Đăng chia sẻ</a>
				<li><a href="compareresult.action">So sánh<span
						id="numberCompare" style="color: red; font-size: 12px">(${number})</span>
				</a></li>
				
			</ul>
			<div id="modal5">
				<div id="heading5">Thông báo !</div>
				<div id="content5">
					<p style="text-align: left; padding-left: 10px; color: black;">Bạn
						cần đăng nhập để sử dụng chức năng này</p>
					<p style="text-align: left; padding-left: 10px; color: black;">Đăng
						nhập với tài khoản của Facebook</p>
						<br/>
					<a style="text-align: left;" href="login.jsp"
						class="button1 green close"><img src="images/dialog/tick.png">Đăng
						nhập</a> <a style="text-align: left;" href="javascript:void(0);"
						class="button1 red close"><img src="images/dialog/cross.png">Đóng</a>
				</div>
			</div>
			<div id="loginPanel">
				<c:choose>
					<c:when test="${displayNamess!=null}">
						<a class="profileButton" href="profileuser.action">${displayNamess}
						</a>
						<ul>
							<c:choose>
								<c:when test="${userRoleIdss==1}">
									<li><a href="adminloadsystem.action">Trang quản lý</a>
								</c:when>
							</c:choose>
							<li><a href="profileuser.action">Trang cá nhân</a></li><li><a href="changepass.jsp">Đổi mật khẩu</a>
							</li>
							<li><a href="logout.jsp">Thoát</a>
							</li>
						</ul>
					</c:when>
					<c:otherwise>
						<a class="loginButton" href="javascript:void(0);" onclick="getcurrenturlvalue();">Đăng nhập</a>
					</c:otherwise>
				</c:choose>
			</div>
			<div id="search">
			<DIV class="search-box">
			  <div style="width: 80%;float: left">
		      <INPUT id="lookup_input" class="search-bar" style="width: 220px;height: 24px;" name="keysearch" value="Tìm Kiếm ..." type="text">
		      </div>
		      <div style="width: 19%;float: right;">
		      <img alt="search" src="images/search.png" width="24" height="24" onclick="searchFull();">
		      </div>
				<SCRIPT type="text/javascript" src="js/searchfulltext.js"></SCRIPT>
		      
		      <FORM id="search-form" method="post" action="fulltextsearch.action">
		      	<INPUT id="sortby" class="search-bar" name="sortby" value="0" type="hidden">
		      </FORM>
      		</DIV>
			</div>  
		</div>
	</div>
<script type="text/javascript">
	$('#lookup_input').bind('keypress', function(e) {
		if(e.keyCode==13){
			searchFull();
		}
	});
	</script>
	<script>
		jQuery(document).ready(function() {
			jQuery('#slideshowHolder').jqFancyTransitions({
				width : 960,
				height : 84
			});
		});
	</script>
	<!--[if !IE]>
            	<img src="images/spacer.gif" width="1" height="56" alt="">
            <![endif]-->
	<img src="images/spacer.gif" width="1" height="56" alt="">
	<div id='slideshowHolder'>

		<img src="images/banner2.jpg" /> <a href='checkaddsharetopic.action' /></a>
	</div>
	<form action="search.action" name="searchForm">
		<div id="boxsearch">
			<table width="100%" border="0" cellspacing="1" cellpadding="1">
				<tr>
					<td width="120px"><span class="tbdownlist1">Thành phố </span>
					</td>
					<td width="120px"><span class="tbdownlist1">Quận/Huyện
					</span>
					</td>
					<td width="120px"><span class="tbdownlist1">Loại tin</span></td>
					<td width="120px"><span class="tbdownlist1">Diện tích </span>
					</td>

					<td width="120px"><span class="tbdownlist1">Giá </span></td>
					<td width="120px" rowspan="2" valign="bottom"><a href="javascript:void(0);"
						class="searchButtonIndex" onclick="document.searchForm.submit();">Tìm
							Kiếm</a>
					</td>
					<td colspan="5"></td>
					<td></td>
				</tr>
				<tr>
					<td><span class="bghead"> <select name="city" id="city"
							class="tbdownlist">
								<option value="0">---Tất cả---</option>
								<s:iterator value="provinces" status="status">
									<option
										value="<s:property value="provinces[#status.index][0]" />">
										<s:property value="provinces[#status.index][1]" />
									</option>
								</s:iterator>
						</select> </span></td>
					<td><span class="bghead"> <select name="district"
							id="district" class="tbdownlist">
								<option value="0">---Tất cả---</option>
						</select> </span></td>
					<td><span class="bghead"> <select name="topictypeid"
							id="topictypeid" class="tbdownlist">
								<option selected value="0">---Tất cả---</option>
								<option value="1">Cho thuê</option>
								<option value="2">Chia sẻ</option>
						</select> </span></td>
					<td><span class="bghead"> <select name="area" id="area"
							class="tbdownlist">
								<option selected value="0">---Tất cả---</option>
								<option value="1"><15m2</option>
								<option value="2">15 - 20m2</option>
								<option value="3">20 - 30m2</option>
								<option value="4">>30m2</option>
						</select> </span></td>
					<td><span class="bghead"> <select name="price"
							id="price" class="tbdownlist">
								<option selected value="0">---Tất cả---</option>
								<option value="1"><2 triệu</option>
								<option value="2">2 - 4 triệu</option>
								<option value="3">4 - 6 triệu</option>
								<option value="4">> 6 triệu</option>
						</select> </span></td>
					<td colspan="3"><a href="inputfuzzy.action">Tìm kiếm gợi ý</a></td>
					<td width="6%"></td>
				</tr>

			</table>
		</div>
	</form>
	<div id="contentmain">
		<div class="container">

			<div class="leftcontent">
				<div class="boxleftcontent" style="max-height: 490px;">
					<div class="filterheader">
						<div class="aligntextleft">Danh mục</div>
					</div>
					<ul class="campaign_navi_left_content">
						<h2 class="campaign_navi_left_cate">Loại tin đăng</h2>
						<li><a href="search.action?topictypeid=0">Tất cả</a></li>
						<li><a href="search.action?topictypeid=1">Cho thuê</a></li>
						<li class="border_bottom"><a
							href="search.action?topictypeid=2">Chia sẻ</a></li>
						<h2 class="campaign_navi_left_cate">Khu vực</h2>

						<li>
							<ul class="campaign_navi_left_content">
								<s:iterator value="provinces" status="status">
									<a
										href="search.action?city=<s:property
											value="provinces[#status.index][0]" />&district=0&area=0&price=0"><s:property
											value="provinces[#status.index][1]" /> </a>
									<s:iterator value="districts" status="status1">
										<s:if
											test="provinces[#status.index][0]==districts[#status1.index][0]">
											<li style="padding-left: 10px"><a
												href="search.action?city=<s:property
											value="provinces[#status.index][0]" />&district=<s:property
											value="districts[#status1.index][1]" />&area=0&price=0"><s:property
														value="districts[#status1.index][2]" /> </a></li>
										</s:if>
									</s:iterator>
								</s:iterator>
							</ul></li>

					</ul>
				</div>
				<div class="boxleftcontent" id="magincustom">
					<div class="fb-like-box"
						data-href="https://www.facebook.com/timkiemvachiasenhatro?ref=ts&amp;fref=ts"
						data-width="249" data-show-faces="true" data-stream="false"
						data-header="false"></div>
				</div>

				<div class="boxleftcontent" id="magincustom">
					<div class="filterheader">
						<div class="aligntextleft">Lượt xem nhiều nhất</div>
					</div>
					<s:iterator value="mostView" status="status">
						<div id="recent">
							<div id="thumbimg">
								<img alt="<s:property value="mostView[#status.index][0]" /> "
									src="Img/Topic/<s:property value="mostView[#status.index][3]" /> "
									width="50" height="55">
							</div>
							<div id="s-info">
								<div id="title">
									<a id="a_title"
										href="detail.action?topicId=<s:property
											value="mostView[#status.index][4]" />&districtId=<s:property
											value="mostView[#status.index][5]" />"><s:property
											value="mostView[#status.index][0]" /> </a>
								</div>
								<div id="address">
									<s:property value="mostView[#status.index][1]" />
								</div>
								<div id="viewn">
									<div id="iconview">
										<img src="images/view.png" alt="" width="15" height="15">
									</div>
									<div id="numberview">
										<s:property value="mostView[#status.index][2]" />
										Lượt xem
									</div>
								</div>
							</div>
						</div>
					</s:iterator>
				</div>
				<div class="boxleftcontent" id="magincustom">
					<div class="filterheader">
						<div class="aligntextleft">Các tin đã xem</div>
					</div>
					<s:iterator value="recentView" status="status1">
						<div id="recent">
							<div id="thumbimg">
								<img alt="<s:property value="recentView[#status1.index][0]" /> "
									src="Img/Topic/<s:property value="recentView[#status1.index][3]" /> "
									width="50" height="55">
							</div>
							<div id="s-info">
								<div id="title">
									<a id="a_title"
										href="detail.action?topicId=<s:property
											value="recentView[#status1.index][4]" />&districtId=<s:property
											value="recentView[#status1.index][5]" />"><s:property
											value="recentView[#status1.index][0]" /> </a>
								</div>
								<div id="address">
									<s:property value="recentView[#status1.index][1]" />
								</div>
								<div id="viewn">
									<div id="iconview">
										<img src="images/view.png" alt="" width="10" height="10">
									</div>
									<div id="numberview">
										<s:property value="recentView[#status1.index][2]" />
										Lượt xem
									</div>
								</div>
							</div>
						</div>
					</s:iterator>
				</div>
			</div>

			<div class="boxleftcontent" id="rightcontent">
				
				<div class="searchform">
					<!--search form-->
					<div class="searchformheader">
						<!--search form header-->
						<span style="margin: 5px 0 5px 15px; padding-top: 5px">Tìm
							kiếm theo gợi ý</span>
						<!--end search form header-->
					</div>
					<form action="fuzzysearch" method="post" name="fuzzysearch">
						<div class="inputform">
							<!--input form-->
							<div style="width: 30%; float: left; padding-top: 5px;">Chi
								tiêu hàng tháng:</div>
							<div style="width: 20%; float: left;">
								<input type="text" name="money" class="box-shadow-input" onkeydown="return jsDecimals(event);">
							</div>
							<div
								style="width: 30%; float: left; padding-top: 5px; padding-left: 5px">
								<span style="color: red">( triệu đồng/tháng )</span>
							</div>
							<!--end input form-->
						</div>
						<div class="inputform">
							<!--price-->
							<div style="width: 30%; float: left; padding-top: 5px;">Số
								người ở:</div>
							<div style="width: 20%; float: left;">
								<select name="numberPerson" class="styled" style="width: 100%"
									class="box-shadow-input">
									<option value="1">1 người</option>
									<option selected value="2">2 người</option>
									<option value="3">3 người</option>
									<option value="4">4 người</option>
									<option value="5">5 người</option>
								</select>
							</div>
						</div>
					
					<div style="margin-left: 38%; margin-right: 38%; margin-top: 20px">
						<input type="submit" class="buttoncus" value="Tìm kiếm">
					</div>
					</form>
					<!--end search form-->
				</div>
				<div id="fuzzysearch_errorloc" class="error_strings errorcus1">
				</div>
		</div>
	</div>
	<div id="footercus" style="text-align: center;">
		<em>Designed by FU team | Powered by Struts<br> khutro.net</em>

	</div>
	<div style="display: none;" class="nav_up" id="nav_up"></div>
	<div style="display: none;" class="nav_down" id="nav_down"></div>
	<script>
		jQuery(function() {
			var $elem = $('#contentmain');

			jQuery('#nav_up').fadeIn('slow');
			jQuery('#nav_down').fadeIn('slow');

			jQuery(window).bind('scrollstart', function() {
				$('#nav_up,#nav_down').stop().animate({
					'opacity' : '0.2'
				});
			});
			jQuery(window).bind('scrollstop', function() {
				$('#nav_up,#nav_down').stop().animate({
					'opacity' : '1'
				});
			});

			jQuery('#nav_down').click(function(e) {
				$('html, body').animate({
					scrollTop : $elem.height()
				}, 800);
			});
			jQuery('#nav_up').click(function(e) {
				$('html, body').animate({
					scrollTop : '0px'
				}, 800);
			});
		});
	</script>
	<script language="JavaScript" type="text/javascript"
		xml:space="preserve">
		//         
		var frmvalidator = new Validator("fuzzysearch");
		frmvalidator.EnableOnPageErrorDisplaySingleBox();
		frmvalidator.EnableMsgsTogether();


		frmvalidator.addValidation("money", "req", "+ Chi tiêu hàng tháng không được trống!");
		frmvalidator.addValidation("money", "numeric", "+ Chi tiêu hàng tháng Hãy nhập số!");
		frmvalidator.addValidation("money", "gt=0", "+ Chi tiêu hàng tháng không được âm!");
		
		frmvalidator.addValidation("percent", "req", "+ % chi tiêu cho nhà trọ không được trống");
		frmvalidator.addValidation("percent", "numeric", "+ % chi tiêu cho nhà trọ Hãy nhập số");
		frmvalidator.addValidation("percent", "gt=0", "+ % chi tiêu cho nhà trọ không được âm!");
		frmvalidator.addValidation("percent", "lt=100", "+ % chi tiêu cho nhà trọ nhỏ hơn 100%!");
		
		//
	</script>
	<!-- End Save for Web Slices -->
	<script type="text/javascript">
		var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel(
				"CollapsiblePanel1");
};
	</script>
</body>
</html>